'use strict';

let debug = require('debug')('book');
let mysqlDao = new require('./mysql/Book.js')();

let DaoDispatcher = function () {
};
module.exports = new DaoDispatcher();

let theProto = DaoDispatcher.prototype;

/**
 * 添加单个entity add single district
 * @param json
 * @returns {*}
 */
theProto.addOne = function*(inParams) {
    //debug('DaoDispatcher', inParams);
    let result = yield mysqlDao.save(inParams);
    return result;
};


theProto.findById = function*(id) {
    let result = yield mysqlDao.findById(id);
    return result;
};

theProto.rawQuery = function*(sql) {
    let result = yield mysqlDao.rawQuery(sql);
    return result;
};
